package seedpod.model;
/**
 * Copyright 2009 University of  Washington
 * This code is released under the GPL version 3 - with a copy of the license included
 * @author Maya Hao Li
 *
 */
public interface SeedpodModel {
	String DEFAULT_META_RDB_SLOT = SeedpodModel.RdbCls.RDB_SLOT;
	String DEFAULT_META_RDB_CLASS = SeedpodModel.RdbCls.RDB_CLASS;

	public static interface RdbCls {
		final static String RDB_CLASS = ":RDB_CLASS";
		final static String RDB_SLOT = ":RDB_ATTRIBUTE";
		final static String XML_CLASS = ":XML_CLASS";
		final static String XML_SLOT = ":XML_SLOT";
		final static String DATABASE = ":DATABASE";
		final static String SEEDPOD_MODEL = ":SEEDPOD_MODEL";
		final static String SYSTEM_CLASS = ":SYSTEM-CLASS";

		final static String DATA_TYPE = "DATA_TYPE";
		final static String METADATA = "Metadata";
		final static String USER = "Seedpod_User";
		final static String ACCESS_LOG = "Access_Log";
		final static String UNIT = "Unit";
		final static String ANNOTATION = "ANNOTATION";
		final static String REIFIED_SLOT_CLS = ":REIFIED_SLOT_CLS";
		final static String THING = ":THING";

		// form widgets
		static enum FormWidget{
			TEXT, RADIO, SELECT, DATE, TIMESTAMP, TEXTAREA, COMBO, CHECKBOX, NUMERIC, OBJECT_LINK, FILE, AUTO_INCREMENT, BOOLEAN, PASSWORD;
			
			public static String[] toArray() {
				FormWidget[] widgets = values();
				String[] names = new String[widgets.length];
				for ( int i = 0 ; i < names.length; i++ ) 
					names[i] = widgets[i].name();
				return names;
			}
			
		}

		// view widgets
		static enum ViewWidget {
			STRING, DATE, OBJECT_LINK, RADIO, CHECKBOX, FILE, NUMERIC, SPREADSHEET, PASSWORD;
			
			public static String[] toArray() {
				ViewWidget[] widgets = values();
				String[] names = new String[widgets.length];
				for ( int i = 0 ; i < names.length; i++ ) 
					names[i] = widgets[i].name();
				return names;
			}

		}

		static enum USER_GROUP {
			COLLABORATOR, PUBLIC, ADMINISTRATOR, EDITOR
		}

		// PERMISSION TYPES -- may not be used
		static enum PERMISSION {
			PUBLIC, ADMINISTRATOR, COLLABORATOR
		}

		// Data_TYPE CLASSES
		final static String TYPE_DATE = "Date";
		final static String TYPE_TIME = "Time";
		final static String TYPE_3D_COORDINANTS = "3D_coordinants";
		final static String TYPE_FILE = "File";

	}

	public static interface RdbSlot {
		// thing slots

		final static String THING_TYPE = "type";
		final static String THING_ID = "ID";
		final static String THING_STATUS = "status";

		// rdb_cls slots
		final static String DATA_SOURCE = ":DATA-SOURCE";
		final static String USER_ASSIGNED_NAME = ":USER-ASSIGNED-NAME";
		static final String JAVA_CLASS = ":JAVA_CLASS";

		// rdb_attribute slots
		final static String DATABASE_INDEX = ":DATABASE-INDEX";
		final static String DATABASE_TYPE = ":DATABASE-TYPE";
		final static String DATABASE_TYPE_PARAMETER = ":DATABASE-TYPE-PARAMETER";
		final static String FORM_WIDGET = ":FORM-WIDGET";
		final static String FORM_WIDGET_PARAMETER = ":FORM-WIDGET-PARAMETER";
		final static String INLINE = ":INLINE";
		final static String PERMISSION = ":PERMISSION";
		final static String UNIQUE = ":UNIQUE";
		final static String UNIT = ":UNIT";
		final static String VALUE_EXPRESSION = ":VALUE-EXPRESSION";
		final static String VIEW_SEQUENCE = ":VIEW-SEQUENCE";
		final static String VIEW_WIDGET = ":VIEW-WIDGET";
		final static String VIEW_WIDGET_PARAMETER = ":VIEW-WIDGET-PARAMETER";

		// seedpod_model slots
		final static String MODEL_CREATOR = "Model_Creator";
		final static String MODEL_DATE = "Model_Date";
		final static String MODEL_VERSION = "Model_Version";

		// Database slots
		final static String DATABASE_JDBC = "DatabaseJDBC";
		final static String DATABASE_NAME = "DatabaseName";
		final static String DATABASE_PASSWORD = "DatabasePassword";
		final static String DATABASE_URL = "DatabaseURL";
		final static String DATABASE_USERNAME = "UserName";

		// user slots
		final static String FIRST_NAME = "first_name";
		final static String LAST_NAME = "last_name";
		final static String USERNAME = "username";
		final static String EMAIL = "email";
		final static String USER_GROUP = "user_group";
		final static String PASSWORD = "password";

		// Date slots
		final static String YEAR = "Year";
		final static String MONTH = "Month";
		final static String DAY = "Day";

		// Time slots
		final static String HOUR = "Hour";
		final static String MINUTE = "Minute";
		final static String SECOND = "Second";

		// 3d coordinate slots
		final static String COORDINATE_UNIT = "unit";
		final static String X = "x";
		final static String Y = "y";
		final static String Z = "z";

		// file slots
		final static String SUBMIT_DATE = "submit_date";
		final static String MIME_TYPE = "mime_type";
		final static String VERSION = "version";
		final static String DESCRIPTION = "description";
		final static String DOMAIN = "domain";
		final static String LABEL = "label";
		final static String SOURCE = "source";

		// access_log slots
		final static String ACCESS_USER = "accessUser";
		final static String ACCESS_ACTION = "action";
		final static String ACCESS_TIMESTAMP = "accessTimestamp";

		// annotation slots
		final static String ANNOTATION_OBJECT = "objectId";
		final static String ANNOTATION_ATTRIBUTE = "attributeName";
		final static String ANNOTATION_TAG = "tag";
		final static String ANNOTATION_COMMENT = "comment";
		final static String ANNOTATION_USER = "userId";
		final static String ANNOTATION_TIMESTAMP = "annotation_ts";
	}

}
